<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

	<form:form commandName="project" cssClass="form-horizontal" role="form">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name_edit">项目名称</label>
			<div class="col-sm-4">
				<input type="text" name="name" id="name_edit" value="${project.name}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="resDept_edit">责任单位</label>
			<div class="col-sm-4">
				<input type="text" name="resDept" id="resDept_edit" value="${project.resDept}"
					   class="form-control ">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="resUser_edit">分管领导</label>
			<div class="col-sm-4">
				<input type="text" name="resUser" id="resUser_edit" value="${project.resUser}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="resPhone_edit">分管领导手机号</label>
			<div class="col-sm-4">
				<input type="text" name="resPhone" id="resPhone_edit" value="${project.resPhone}"
					   class="form-control ">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="contactName_edit">项目联系人</label>
			<div class="col-sm-4">
				<input type="text" name="contactName" id="contactName_edit" value="${project.contactName}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="contactPhone_edit">项目联系人手机号</label>
			<div class="col-sm-4">
				<input type="text" name="contactPhone" id="contactPhone_edit" value="${project.contactPhone}"
					   class="form-control ">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="ownerUnitPerson_edit">项目责任人</label>
			<div class="col-sm-4">
				<input type="text" name="ownerUnitPerson" id="ownerUnitPerson_edit" value="${project.ownerUnitPerson}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="ownerUnitPersonPhone_edit">项目责任人手机号</label>
			<div class="col-sm-4">
				<input type="text" name="ownerUnitPersonPhone" id="ownerUnitPersonPhone_edit" value="${project.ownerUnitPersonPhone}"
					   class="form-control ">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="money_edit">计划投资总额(万)</label>
			<div class="col-sm-4">
				<input type="number" name="money" id="money_edit" value="${project.money}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="address_edit">初步选址</label>
			<div class="col-sm-4">
				<input type="text" name="address" id="address_edit" value="${project.address}"
					   class="form-control ">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="industryType_edit">行业分类</label>
			<div class="col-sm-4">
				<select name="industryType" id="industryType_edit" class="form-control">
					<option value="">请选择</option>
					<option value="1001">旅游特色小镇项目</option>
					<option value="1002">工业项目</option>
					<option value="1003">交通</option>
					<option value="1004">城镇基础设施</option>
					<option value="1005">安置房项目</option>
					<option value="1006">社会事业项目</option>
					<option value="1007">商住项目</option>
					<option value="1008">农林水利环保生态项目</option>
				</select>
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="schedCode_edit">进度分类</label>
			<div class="col-sm-4">
				<select name="schedCode" id="schedCode_edit" class="form-control">
					<option value="">请选择</option>
					<option value="3001">前期项目</option>
					<option value="3002">开工项目</option>
					<option value="3003">在建提速</option>
					<option value="3004">竣工项目</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="projectType_edit">项目分类</label>
			<div class="col-sm-4">
				<select name="projectType" id="projectType_edit" class="form-control">
					<option value="">请选择</option>
					<option value="2001">计划新开工项目</option>
					<option value="2002">结转项目</option>
				</select>
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="occupyDept_edit">征迁实施单位</label>
			<div class="col-sm-4">
				<input type="text" id="occupyDept_edit" name="occupyDept" value="${project.occupyDept}"
					   class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="occupyResUser_edit">征迁责任人</label>
			<div class="col-sm-4">
				<input type="text" id="occupyResUser_edit" name="occupyResUser" value="${project.occupyResUser}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="occupyResUserPhone_edit">征迁责任人手机号</label>
			<div class="col-sm-4">
				<input type="text" id="occupyResUserPhone_edit" name="occupyResUserPhone" value="${project.occupyResUserPhone}"
					   class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="occupyOperateUser_edit">征迁经办人</label>
			<div class="col-sm-4">
				<input type="text" id="occupyOperateUser_edit" name="occupyOperateUser" value="${project.occupyOperateUser}"
					   class="form-control ">
			</div>
			<label class="col-sm-2 control-label no-padding-right" for="occupyOperateUserPhone_edit">征迁经办人手机号</label>
			<div class="col-sm-4">
				<input type="text" id="occupyOperateUserPhone_edit" name="occupyOperateUserPhone" value="${project.occupyOperateUserPhone}"
					   class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="describes_edit">建设内容</label>
			<div class="col-sm-10">
            <textarea rows="2" id="describes_edit" name="describes"
					  class="form-control ">${project.describes}</textarea>
			</div>
		</div>
		<input type="text" name="sysId"  hidden value="${project.sysId}">
	</form:form>
<script>
    jQuery(function($) {
        $(".date-picker").datepicker({
            inline: true,
            format:"yyyymmdd",
            autoclose: true,
            todayHighlight: true,
            language: 'cn'
        }).next().on(ace.click_event, function(){
            $(this).prev().focus();
        });
    });
    //行业分类
    var industryType = ${project.industryType};
    var industryTypes = $("#industryType_edit>option");
    for (var i = 0; i < industryTypes.length; i++) {
        if (industryTypes[i].value == industryType) {
            industryTypes[i].setAttribute("selected", "true");
        } else {
            industryTypes[i].removeAttribute("selected");
        }
    }
    //进度分类
    var schedCode = ${project.schedCode};
    var schedCodes = $("#schedCode_edit>option");
    for (var i = 0; i < schedCodes.length; i++) {
        if (schedCodes[i].value == schedCode) {
            schedCodes[i].setAttribute("selected", "true");
        } else {
            schedCodes[i].removeAttribute("selected");
        }
    }
    //项目分类
    var projectType = ${project.projectType};
    var projectTypes = $("#projectType_edit>option");
    for (var i = 0; i < projectTypes.length; i++) {
        if (projectTypes[i].value == projectType) {
            projectTypes[i].setAttribute("selected", "true");
        } else {
            projectTypes[i].removeAttribute("selected");
        }
    }
    //修改项目（确认修改）
    $("#editPro").click(function () {
        var win = confirm("温馨提示：确认修改该项目?");
        if (win == true) {
            executeSaveOrUpdate({
                formId: "#formDialog form",
                dialogId: "#formDialog",
                url: "/projects/editProjectInfo",
                tableId: "#gridTable",
                successMessage: "提交成功",
                successTitle: '保存对话框',
                //failMessage: '保存失败',
                failTitle: '消息对话框'
            });
		}
	})

</script>